<?php

namespace Yolo\Log;

/**
 * AbstractLog
 * @author lushaoming<lushaoming6@gmail.com>
 * @date 2024/2/5
 */
abstract class AbstractLog implements LogInterface
{
    public function debug(string|array $log): void
    {
        $this->writeLog(EnumLogLevel::DEBUG, $log);
    }

    public function info(string|array $log): void
    {
        $this->writeLog(EnumLogLevel::INFO, $log);
    }

    public function warning(string|array $log): void
    {
        $this->writeLog(EnumLogLevel::WARNING, $log);
    }

    public function error(string|array $log): void
    {
        $this->writeLog(EnumLogLevel::ERROR, $log);
    }

    abstract protected function writeLog(EnumLogLevel $level, string|array $log);
}